package com.siwei.mes.controller;

import com.siwei.mes.common.result.ApiResult;
import com.siwei.mes.common.result.Json;
import com.siwei.mes.entity.OrderDynamic;
import com.siwei.mes.service.OrderDynamicService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 工单动态(OrderDynamic)表控制层
 *
 * @author makejava
 * @since 2023-12-05 09:31:36
 */
@Api(value = "工单动态")
@RestController
@RequestMapping("orderDynamic")
public class OrderDynamicController {
    @Resource
    private OrderDynamicService orderDynamicService;

    @ApiOperation(value = "获取所有工单动态")
    @GetMapping("getListByOrderId")
    public Json getListByOrderId(@RequestParam("orderId") Long orderId) {
        OrderDynamic entity = new OrderDynamic();
        entity.setOrderId(orderId);
        return Json.succ().data(ApiResult.addList(orderDynamicService.getAll(entity)));
    }

}
